/*
 * Author: kael http://weibo.com/loskael
 */
package los.kael.css;

/**
 * <p>
 * 定义样式表
 * </p>
 * 
 * @author kael http://weibo.com/loskael
 * @version $FileName: Style.java $Date: 2011-11-2 下午4:12:45 -0400 2011
 * @since 1.0
 * 
 */
public class Style {
	/**
	 * <p>
	 * 标签
	 * </p>
	 */
	private String tag;
	/**
	 * <p>
	 * 属性和对应的值
	 * </p>
	 */
	private String value;

	public Style(String tag, String value) {
		this.tag = tag;
		this.value = value;
	}

	public String getTag() {
		return tag;
	}

	public String getValue() {
		return value;
	}

	public Style setValue(Style style) {
		this.value = this.value + ";" + style.value;
		return this;
	}

	public Style setTag(Style style) {
		this.tag = this.tag + "," + style.tag;
		return this;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Style) {
			Style style = (Style) obj;
			if (this.value == style.value) {
				return true;
			}
		}
		return false;
	}

	@Override
	public String toString() {
		return tag + "{" + value + "}";
	}
}
